package com.longge;

import java.util.Arrays;

/**
 * @创建人 xinglongge
 * @创建时间 2021/10/20
 * @描述
 */
public class LengthOfLIS {


    public int lengthOfLIS(int[] nums) {
        int res = 1;
        int[] dp = new int[nums.length];
        Arrays.fill(dp, 1);
        for (int i = 1; i < nums.length; i++) {
            for (int j = 0; j < i; j++) {
                if (nums[j] < nums[i]) {
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                    res = Math.max(dp[i], res);
                }
            }
        }
        return res;

    }

    public static void main(String[] args) {
        new LengthOfLIS().lengthOfLIS(new int[]{1, 3, 6, 7, 9, 4, 10, 5, 6});
    }


}
